package com.dk.common.dbaccess.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Getter;
import lombok.Setter;

import java.io.Serial;
import java.time.LocalDateTime;

@Getter
@Setter
public abstract class AbstractBaseEntity extends AbstractEntity<Long> {

    @Serial
    private static final long serialVersionUID = -4899284492975339960L;

    @TableId(
            value = "id",
            type = IdType.AUTO
    )
    protected Long id;


    @TableField(value = "created_by_user", fill = FieldFill.INSERT)
    private String createdBy;

    @TableField(value = "created_by_name", fill = FieldFill.INSERT)
    private String createdByName;

    @TableField(value = "created_date", fill = FieldFill.INSERT)
    private LocalDateTime createdDate;



    @TableField(value = "last_modified_by_user", fill = FieldFill.INSERT)
    private Long lastModifiedBy;

    @TableField(value = "last_modified_by_name", fill = FieldFill.INSERT)
    private String lastModifiedByName;


    @TableField(value = "last_modified_date", fill = FieldFill.INSERT)
    private LocalDateTime lastModifiedDate;



    @Override
    public Long getId() {
        return id;
    }

    @Override
    public void setId(Long id) {
        this.id = id;
    }

}
